﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QQ.Singleton
{
    class Program
    {
        static readonly Lazy<AObjectClass> singleton = new Lazy<AObjectClass>();

        static AObjectClass GetInstance()
        {
            return singleton.Value;
        }
        static void Main(string[] args)
        {
            Console.WriteLine(singleton.IsValueCreated);
            GetInstance().WriteSomethings();
            Console.WriteLine(singleton.IsValueCreated);

            Console.ReadKey();
        }
    }
}
